package com.gougang.interview;

import java.util.Random;

/**
 * Created by 16978 on 2017/4/6.
 */
public class Utils {
    public static int getRandom(int max) {
        Random random = new Random();
        return random.nextInt(max);
    }

    public static String getPokerNumber(int number) {

        switch (number) {
            case 1:
                return "A";
            case 11:
                return "J";
            case 12:
                return "Q";
            case 13:
                return "K";
            default:
                return number + "";
        }
    }

    public static int getCardScore(CardType type) {
        if (type == CardType.Hearts || type == CardType.Spade) {
            return 30;
        }
        return 20;
    }

    public static void main(String[] args) {
        for (int i = 0; i < 20; i++) {
            System.out.println(getRandom(52));
        }
    }
}
